﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ctem.gui.SignalChart.Test
{
    public partial class Form1 : Form
    {
        private int tick = 0;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //for (int i=1; i<10000; i++)
            //    SignalChartBox1.AddPoint(10);
            //SignalChartBox1.Refresh();    
            //SignalChartBox1.StartDrawChart();
        }

        private void Form1_Shown(object sender, EventArgs e)
        {
            SignalChartBox1.AddSeries(new Series("sin", Color.Blue));
            SignalChartBox1.AddSeries(new Series("cos", Color.Red));
            SignalChartBox1.AddSeries(new Series("exp", Color.Green));
            //for (int i = 0; i < 1000; i++)
            //{
                
            //    SignalChartBox1.AddItem("sin", (float)(20 * Math.Sin(0.1 * i)));
            //    SignalChartBox1.AddItem("cos", (float)(20 * Math.Cos(0.1 * i)));
            //    SignalChartBox1.AddItem("exp", (float)(Math.Exp( 0.01*i)));
            //}

        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            
            //SignalChartBox1.AddItem("sin", (float)(20 * Math.Sin(0.1 * tick)));
            //SignalChartBox1.AddItem("cos", (float)(20 * Math.Cos(0.1 * tick)));
            //SignalChartBox1.AddItem("exp", (float)(Math.Exp(0.01 * tick)));
            //tick++;
            SignalChartBox1.Refresh();
        }
    }
}
